Skip to content

build(cudnn-sys): Add CUDNN_INCLUDE_DIR #213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 21, 2025

Conversation

giantcow
Copy link
Contributor

Enables users to specify a non-standard cuDNN install path. This seems to be needed for the newer editions of the CUDA toolkit, as cuDNN isn't included by default (at least in the Fedora repo's, you have to install from a tarball)

Enables users to specify a non-standard cuDNN install path. This seems
to be needed for the newer editions of the CUDA toolkit, as cuDNN isn't
included by default (at least in the Fedora repo's, you have to install
from a tarball)
Copy link
Contributor

@LegNeato LegNeato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR and welcome to the project 🍻 !

I think it would be a bit more idiomatic like:

let mut cudnn_paths: Vec<&Path> = CUDNN_DEFAULT_PATHS.iter().map(Path::new).collect();
if let Some(override_path) = env::var_os("CUDNN_INCLUDE_DIR") {
    cudnn_paths.push(Path::new(&override_path));
}

cudnn_paths
    .iter()
    .find(|p| Self::is_cudnn_include_path(p))
    .map(|p| p.to_path_buf())
    .ok_or("Cannot find cuDNN include directory.".into())

@giantcow giantcow requested a review from LegNeato May 20, 2025 06:00
@LegNeato LegNeato merged commit c41862a into Rust-GPU:main May 21, 2025
7 checks passed
@LegNeato
Copy link
Contributor

Thanks again for the PR! 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants